import request from '@/utils/request'
/**
 *
 * 员工管理
 *
 **/
// 登录
export const login = (data: any) =>
  request({
    'url': '/employee/login',
    'method': 'POST',
    'data': data
  })

  // 退出
 export const userLogout = (params: any) =>
   request({
     'url': `/employee/logout`,
     'method': 'POST',
     'params': params
   })

  // 员工查询并分页
 export const getEmployeeList = (params: any) =>
   request({
     'url': `/employee/page`,
     'method': 'GET',
     'params': params
   })

  // 启用禁用员工帐号
 export const enableOrDisableEmployee = (params: any) =>
   request({
     'url': `/employee/status/${params.status}`,
     'method': 'POST',
     'params': {id: params.id}
   })

// 新增员工
export const addEmployee = (data: any) =>
  request({
    'url': '/employee',
    'method': 'POST',
    'data': data
  })

// 修改员工
export const updateEmployee = (params: any) =>
  request({
    'url': '/employee/update',
    'method': 'PUT',
    'data': params
  })

// 删除员工
export const deleteEmployee = (id: any) =>
  request({
    'url': '/employee/delete',
    'method': 'delete',
    'params': id
  })

// 根据id查询员工，并显示对应修改的员工数据
export const queryEmployeeById = (id: Number) =>
  request({
    'url': `/employee/update/${id}`,
    'method': 'GET',
  })


